<div id="div_imprimir">
    <?php
    echo $this->Html->link(
            $this->Html->image('impresora.png', array('width' => 40, 'alt' => 'imprimir')), array('controller' => 'jobs', 'action' => 'imprimir_view'), array('escape' => false, 'target' => '_blank')
    );
    ?>
</div>
<div class="jobs view">
    <h2><?php
    $tipo = $job['Job']['type'] == 'event' ? 'Evento' : 'Cumpleaños';
    echo $tipo;
    ?></h2>

    <?php if ($job['Job']['paid'] == 'yes') {
        ?>
        <div class="paid_job">Trabajo Pagado</div>
        <?php
    }
    ?>
    <dl><?php
    $i = 0;
    $class = ' class="altrow"';
    ?>
        <dt<?php
        if ($i % 2 == 0)
            echo $class;
    ?>><?php __('Fecha de Inicio'); ?></dt>
        <dd<?php
            if ($i++ % 2 == 0)
                echo $class;
    ?>>
                <?php echo date('d/m/Y', strtotime($job['Job']['start_date'])); ?>
            &nbsp;&nbsp;&nbsp;&nbsp;
            <?php echo date('H:i', strtotime($job['Job']['start_date'])) . ' - ' . date('H:i', strtotime($job['Job']['finish_date'])); ?>

        </dd>
        <dt<?php
            if ($i % 2 == 0)
                echo $class;
            ?>><?php __('Dirección'); ?></dt>
        <dd<?php
            if ($i++ % 2 == 0)
                echo $class;
            ?>>
                <?php echo $job['Job']['address']; ?>
            &nbsp;
        </dd>
        <dt<?php
                if ($i % 2 == 0)
                    echo $class;
                ?>><?php __('Teléfono Fijo'); ?></dt>
        <dd<?php
            if ($i++ % 2 == 0)
                echo $class;
                ?>>
                <?php echo $job['Job']['phone_number']; ?>
            &nbsp;
        </dd>
        <dt<?php
                if ($i % 2 == 0)
                    echo $class;
                ?>><?php __('Teléfono Celular'); ?></dt>
        <dd<?php
            if ($i++ % 2 == 0)
                echo $class;
                ?>>
                <?php echo $job['Job']['movil_number']; ?>
            &nbsp;
        </dd>
        <dt<?php
                if ($i % 2 == 0)
                    echo $class;
                ?>><?php __('Email'); ?></dt>
        <dd<?php
            if ($i++ % 2 == 0)
                echo $class;
                ?>>
                <?php echo $job['Job']['email']; ?>
            &nbsp;
        </dd>
        <dt<?php
                if ($i % 2 == 0)
                    echo $class;
                ?>><?php __('Tipo de Precio'); ?></dt>
        <dd<?php
            if ($i++ % 2 == 0)
                echo $class;
                ?>>
                <?php echo $pricetypes[$job['Job']['pricetype_id']]; ?>
            &nbsp;
        </dd>
        <dt<?php
                if ($i % 2 == 0)
                    echo $class;
                ?>><?php __('Nombre del Contacto'); ?></dt>
        <dd<?php
            if ($i++ % 2 == 0)
                echo $class;
                ?>>
                <?php echo $job['Job']['contact_name']; ?>
            &nbsp;
        </dd>
        <?php
        if ($job['Job']['type'] == 'birthday') {
            ?>
            <dt<?php
        if ($i % 2 == 0)
            echo $class;
            ?>><?php __('Nombre del Cumpleañero/a'); ?></dt>
            <dd<?php
            if ($i++ % 2 == 0)
                echo $class;
            ?>>
                    <?php echo $job['Job']['birthday_name']; ?>
                &nbsp;
            </dd>
            <dt<?php
                if ($i % 2 == 0)
                    echo $class;
                    ?>><?php __('Fecha de Nacimiento'); ?></dt>
            <dd<?php
            if ($i++ % 2 == 0)
                echo $class;
                    ?>>
                    <?php
                    if ($job['Job']['birthday_date'] != '0000-00-00 00:00:00' && $job['Job']['birthday_date'] != NULL) {
                        echo date('d/m/Y', strtotime($job['Job']['birthday_date']));
                    }
                    ?>
                &nbsp;
            </dd>
            <dt<?php
                if ($i % 2 == 0)
                    echo $class;
                    ?>><?php __('Edad'); ?></dt>
            <dd<?php
            if ($i++ % 2 == 0)
                echo $class;
                    ?>>
                    <?php echo $job['Job']['age']; ?>
                &nbsp;
            </dd>
            <?php
        }
        if ($job['Job']['type'] == 'event') {
            ?>
            <dt<?php
        if ($i % 2 == 0)
            echo $class;
            ?>><?php __('Nombre del Evento'); ?></dt>
            <dd<?php
            if ($i++ % 2 == 0)
                echo $class;
            ?>>
                    <?php echo $job['Job']['event_name']; ?>
                &nbsp;
            </dd>
            <?php
        }
        if ($job['Job']['pelotero_id'] != NULL) {
            ?>
            <dt<?php
        if ($i % 2 == 0)
            echo $class;
            ?>><?php __('Pelotero'); ?></dt>
            <dd<?php
            if ($i++ % 2 == 0)
                echo $class;
            ?>>
                    <?php echo $job['Job']['pelotero_id'] != NULL ? $peloteros[$job['Job']['pelotero_id']] : ''; ?>
                &nbsp;
            </dd>
            <?php
        }
        ?>
        <dt<?php
        if ($i % 2 == 0)
            echo $class;
        ?>><?php __('Cantidad de Invitados'); ?></dt>
        <dd<?php
            if ($i++ % 2 == 0)
                echo $class;
        ?>>
                <?php echo $job['Job']['count_invited']; ?>
            &nbsp;
        </dd>
        <dt<?php
                if ($i % 2 == 0)
                    echo $class;
                ?>><?php __('Seña'); ?></dt>
        <dd<?php
            if ($i++ % 2 == 0)
                echo $class;
                ?>>
                <?php echo '$' . $job['Job']['sign']; ?>
            &nbsp;
            <?php
            if ($job['Job']['sign'] == NULL && $job['Job']['paid'] == 'no') {
                echo $this->Html->link(__('Cargar Seña', true), array(), array('onclick' => 'mostrar_carga_senia(1); return false;'));
                ?> 
                <div id="div_cargar_senia" class="jobs form" style="display: none;">
                    <?php echo $this->Form->create('Job', array('url' => array('controller' => 'jobs', 'action' => 'agregar_senia', $job['Job']['id']))); ?>
                    <fieldset>
                        <legend><?php __('Agregar Seña'); ?></legend>
                        <?php
                        echo $this->Form->input('sign', array('label' => 'Seña'));
                        ?>
                    </fieldset>
                    <?php echo $this->Form->submit(__('Cancelar', true), array('id' => 'button_cancelar', 'onclick' => 'mostrar_carga_senia(0); return false;')); ?>
                    <?php echo $this->Form->submit(__('Agregar', true)); ?>
                    <?php echo $this->Form->end(); ?>
                </div>
                <?php
            }
            ?>
        </dd>
        <dt<?php
            if ($i % 2 == 0)
                echo $class;
            ?>><?php __('Notas'); ?></dt>
        <dd<?php
            if ($i++ % 2 == 0)
                echo $class;
            ?>>
                <?php echo $job['Job']['description']; ?>
            &nbsp;
        </dd>

        <!--<dt<?php
                //if ($i % 2 == 0)
//echo $class; 
                ?>><?php __('Pagado'); ?></dt>
        <dd<?php
        //if ($i++ % 2 == 0)
//echo $class; 
                ?>>
        <?php //echo $job['Job']['paid']; ?>
            &nbsp;
        </dd>-->
        <dt<?php
        if ($i % 2 == 0)
            echo $class;
        ?>><?php __('Fecha de Carga'); ?></dt>
        <dd<?php
            if ($i++ % 2 == 0)
                echo $class;
        ?>>
                <?php echo date('d/m/Y H:i:s', strtotime($job['Job']['created'])); ?>
            &nbsp;
        </dd>
    </dl>
</div>
<br/>
<hr/>
<br/>
<div class="related">
    <h2><?php __('Movimientos de Caja Chica'); ?></h2>
    <table cellpadding = "0" cellspacing = "0">
        <tr>
            <th><?php __('Quien'); ?></th>
            <th><?php __('Acción'); ?></th>
            <th><?php __('Monto'); ?></th>
            <th><?php __('Hora'); ?></th>
        </tr>
        <?php
        if (empty($movimientos)) {
            ?> 
            <tr>
                <td colspan="4">No se registran otros movimientos de caja</td>
            </tr>   
            <?php
        }

        $i = 0;
        $total_movimientos = 0;
        foreach ($movimientos as $movimiento) {
            $total_movimientos += $movimiento['CashMovement']['amount'];
            if ($i++ % 2 == 0) {
                $class = ' class="altrow"';
            }
            ?>
            <tr<?php echo $class; ?>>
                <td><?php echo $users[$movimiento['CashMovement']['user_id']]; ?></td>
                <td>
                    <?php
                    if ($movimiento['CashMovement']['type'] == 'in') {
                        $tipo = 'Entrada';
                    } else {
                        $tipo = 'Salida';
                    }
                    echo $tipo;
                    ?>
                </td>
                <td>$<?php echo $movimiento['CashMovement']['amount']; ?></td>
                <td><?php echo date('H:i:s', strtotime($movimiento['CashMovement']['created'])); ?></td>
            </tr>
            <?php
        }
        ?>
    </table>
    <div class="clear"></div>
</div>
<?php
if ($job['Job']['paid'] == 'no') {
    echo $this->Html->link(__('Cargar Movimiento de Caja Chica', true), array(), array('onclick' => 'mostrar_carga_movimiento(1); return false;'));
}
?> 
<br />
<div id="div_cargar_movimiento" class="jobs form" style="display: none;">
    <?php echo $this->Form->create('Job', array('id' => 'MovementForm', 'url' => array('controller' => 'jobs', 'action' => 'cargar_movimiento', $job['Job']['id']))); ?>
    <fieldset>
        <legend><?php __('Agregar Movimiento de Ingreso'); ?></legend>
        <?php
        echo $this->Form->input('amount', array('label' => 'Monto'));
        ?>
    </fieldset>
    <?php echo $this->Form->submit(__('Cancelar', true), array('id' => 'button_cancelar', 'onclick' => 'mostrar_carga_movimiento(0); return false;')); ?>
    <?php echo $this->Form->submit(__('Agregar', true)); ?>
    <?php echo $this->Form->end(); ?>
</div>
<div style="clear:both;"></div>
<br/>
<hr/>
<br/>
<div class="related">
    <h2><?php __('Movimientos de Caja Grande'); ?></h2>
    <table cellpadding = "0" cellspacing = "0">
        <tr>
            <th><?php __('Quien'); ?></th>
            <th><?php __('Acción'); ?></th>
            <th><?php __('Monto'); ?></th>
            <th><?php __('Hora'); ?></th>
        </tr>
        <?php
        if (empty($movimientos_grandes)) {
            ?> 
            <tr>
                <td colspan="4">No se registran otros movimientos de caja</td>
            </tr>   
            <?php
        }

        $i = 0;
        $total_movimientos_grandes = 0;
        foreach ($movimientos_grandes as $movimiento_grande) {
            $total_movimientos_grandes += $movimiento_grande['BigCashMovement']['amount'];
            if ($i++ % 2 == 0) {
                $class = ' class="altrow"';
            }
            ?>
            <tr<?php echo $class; ?>>
                <td><?php echo $users[$movimiento_grande['BigCashMovement']['user_id']]; ?></td>
                <td>
                    <?php
                    if ($movimiento_grande['BigCashMovement']['type'] == 'in') {
                        $tipo = 'Entrada';
                    } else {
                        $tipo = 'Salida';
                    }
                    echo $tipo;
                    ?>
                </td>
                <td>$<?php echo $movimiento_grande['BigCashMovement']['amount']; ?></td>
                <td><?php echo date('d/m/Y H:i:s', strtotime($movimiento_grande['BigCashMovement']['created'])); ?></td>
            </tr>
            <?php
        }
        ?>
    </table>
    <div class="clear"></div>
</div>
<?php
if ($job['Job']['paid'] == 'no') {
    echo $this->Html->link(__('Cargar Movimiento de Caja Grande', true), array(), array('onclick' => 'mostrar_carga_movimiento_grande(1); return false;'));
}
?> 
<br />
<div id="div_cargar_movimiento_grande" class="jobs form" style="display: none;">
    <?php echo $this->Form->create('BigCashMovement', array('id' => 'BigMovementForm', 'url' => array('controller' => 'jobs', 'action' => 'cargar_movimiento_grande', $job['Job']['id']))); ?>
    <fieldset>
        <legend><?php __('Agregar Movimiento de Ingreso'); ?></legend>
        <?php
        echo $this->Form->input('amount', array('label' => 'Monto'));
        ?>
    </fieldset>
    <?php echo $this->Form->submit(__('Cancelar', true), array('id' => 'button_cancelar', 'onclick' => 'mostrar_carga_movimiento_grande(0); return false;')); ?>
    <?php echo $this->Form->submit(__('Agregar', true)); ?>
    <?php echo $this->Form->end(); ?>
</div>
<div style="clear:both;"></div>
<?php
if (isset($job['detalles']['reception'])) {
    ?>
    <br/>
    <hr/>
    <br/>
    <div class="related">
        <h2><?php __('Presentación'); ?></h2>
        <?php
        foreach ($job['detalles']['reception'] as $reception) {
            ?>
            <table cellpadding = "0" cellspacing = "0">
                <tr>
                    <th><?php __('Empleado'); ?></th>
                    <th><?php __('Traje'); ?></th>
                    <th><?php __('Pago a Empleado'); ?></th>
                    <th><?php __('Estado'); ?></th>
                </tr>
                <?php
                $i = 0;
                foreach ($reception['JobsDetailsEmployee'] as $recep_employees) {
                    $class = null;
                    if ($i++ % 2 == 0) {
                        $class = ' class="altrow"';
                    }
                    ?>
                    <tr<?php echo $class; ?>>
                        <td><?php echo $recep_employees['employee_id'] != NULL ? $employees[$recep_employees['employee_id']] : 'Sin Definir'; ?></td>
                        <td><?php echo $costumes[$recep_employees['costume_id']]; ?></td>
                        <td>$<?php echo $recep_employees['cost']; ?></td>
                        <?php
                        if ($recep_employees['paid'] == 0) {
                            $estado = 'No Pagado';
                            $clase = 'no_paid';
                        } else {
                            $estado = 'Pagado';
                            $clase = 'paid';
                        }
                        ?>
                        <td class="<?php echo $clase ?>"><?php echo $estado; ?></td>
                    </tr>
                    <?php
                }
                ?>
            </table>
            <?php
        }
        ?>
    </div>
    <div class="job_subtotal ver">
        Costo Total Presentación = $<?php echo $reception['JobsDetail']['cost']; ?>
    </div>
    <div class="clear"></div>
    <?php
}
?>
<?php
if (isset($job['detalles']['animation'])) {
    ?>
    <br/>
    <hr/>
    <br/>
    <div class="related">
        <h2><?php __('Animación'); ?></h2>
        <?php
        foreach ($job['detalles']['animation'] as $animation) {
            ?>
            <table cellpadding = "0" cellspacing = "0">
                <tr>
                    <th><?php __('Empleado'); ?></th>
                    <th><?php __('Pago a Empleado'); ?></th>
                    <th><?php __('Estado'); ?></th>
                </tr>
                <?php
                $i = 0;
                foreach ($animation['JobsDetailsEmployee'] as $anim_employees) {
                    $class = null;
                    if ($i++ % 2 == 0) {
                        $class = ' class="altrow"';
                    }
                    ?>
                    <tr<?php echo $class; ?>>
                        <td><?php echo $anim_employees['employee_id'] != NULL ? $employees[$anim_employees['employee_id']] : 'Sin Definir'; ?></td>
                        <td>$<?php echo $anim_employees['cost']; ?></td>
                        <?php
                        if ($anim_employees['paid'] == 0) {
                            $estado = 'No Pagado';
                            $clase = 'no_paid';
                        } else {
                            $estado = 'Pagado';
                            $clase = 'paid';
                        }
                        ?>
                        <td class="<?php echo $clase ?>"><?php echo $estado; ?></td>
                    </tr>
                    <?php
                }
                ?>
            </table>
            <div class="job_subtotal ver">
                Costo Total Animación = $<?php echo $animation['JobsDetail']['cost']; ?>
            </div>
            <div class="clear"></div>
            <?php
        }
        ?>
    </div>
    <?php
}
?>    
<?php
if (isset($job['detalles']['show'])) {
    ?>
    <br/>
    <hr/>
    <br/>
    <div class="related">
        <h2><?php __('Shows'); ?></h2>
        <?php
        $costo_total_shows = 0;
        foreach ($job['detalles']['show'] as $show) {
            $costo_total_shows += $show['JobsDetail']['cost'];
            ?>
            <h3><?php echo $shows[$show['JobsDetail']['show_id']]; ?></h3>
            <table cellpadding = "0" cellspacing = "0">
                <tr>
                    <th><?php __('Empleado'); ?></th>
                    <th><?php __('Traje'); ?></th>
                    <th><?php __('Pago a Empleado'); ?></th>
                    <th><?php __('Estado'); ?></th>
                </tr>
                <?php
                $i = 0;
                foreach ($show['JobsDetailsEmployee'] as $show_emp) {
                    $class = null;
                    if ($i++ % 2 == 0) {
                        $class = ' class="altrow"';
                    }
                    ?>
                    <tr<?php echo $class; ?>>
                        <td><?php echo $show_emp['employee_id'] != NULL ? $employees[$show_emp['employee_id']] : 'Sin Definir'; ?></td>
                        <td><?php echo $costumes[$show_emp['costume_id']]; ?></td>
                        <td>$<?php echo $show_emp['cost']; ?></td>
                        <?php
                        if ($show_emp['paid'] == 0) {
                            $estado = 'No Pagado';
                            $clase = 'no_paid';
                        } else {
                            $estado = 'Pagado';
                            $clase = 'paid';
                        }
                        ?>
                        <td class="<?php echo $clase ?>"><?php echo $estado; ?></td>
                    </tr>
                    <?php
                }
                ?>
            </table>
            <div class="job_sub_subtotal ver">
                Costo Show = $<?php echo $show['JobsDetail']['cost']; ?>
            </div>
            <div class="clear"></div>
            <?php
        }
        ?>
        <div class="job_subtotal ver">
            Costo Total Shows = $<?php echo $costo_total_shows; ?>
        </div>
        <div class="clear"></div>
    </div>
    <?php
}
?>  
<?php
if (isset($job['detalles']['service'])) {
    ?>
    <br/>
    <hr/>
    <br/>
    <div class="related">
        <h2><?php __('Servicios'); ?></h2>
        <table cellpadding = "0" cellspacing = "0">
            <tr>
                <th><?php __('Servicio'); ?></th>
                <th><?php __('Proveedor'); ?></th>
                <th><?php __('Precio Proveedor'); ?></th>
                <th><?php __('Costo a Cliente'); ?></th>
                <th><?php __('Estado Proveedor'); ?></th>
            </tr>
            <?php
            $i = 0;
            $costo_total_servicios = 0;
            foreach ($job['detalles']['service'] as $serv_detail) {
                $costo_total_servicios += $serv_detail['JobsDetail']['cost'];
                $class = null;
                if ($i++ % 2 == 0) {
                    $class = ' class="altrow"';
                }
                ?>
                <tr<?php echo $class; ?>>
                    <td><?php echo $services[$serv_detail['JobsDetail']['service_id']]; ?></td>
                    <td><?php echo $providers[$serv_detail['JobsDetail']['provider_id']]; ?></td>
                    <td>$<?php echo $serv_detail['JobsDetail']['price']; ?></td>
                    <td>$<?php echo $serv_detail['JobsDetail']['cost']; ?></td>
                    <?php
                    if ($serv_detail['JobsDetail']['provider_paid'] == 0) {
                        $estado = 'No Pagado';
                        $clase = 'no_paid';
                    } else {
                        $estado = 'Pagado';
                        $clase = 'paid';
                    }
                    ?>
                    <td class="<?php echo $clase ?>"><?php echo $estado; ?></td>
                </tr>
                <?php
            }
            ?>
        </table>
        <div class="job_subtotal ver">
            Costo Total Servicios = $<?php echo $costo_total_servicios; ?>
        </div>
        <div class="clear"></div>
    </div>
    <?php
}
?>        
<?php
if (isset($job['detalles']['production'])) {
    ?>
    <br/>
    <hr/>
    <br/>
    <div class="related">
        <h2><?php __('Obras'); ?></h2>
        <?php
        $costo_total_productions = 0;
        foreach ($job['detalles']['production'] as $production) {
            $costo_total_productions += $production['JobsDetail']['cost'];
            ?>
            <h3><?php echo $productions[$production['JobsDetail']['production_id']]; ?></h3>
            <table cellpadding = "0" cellspacing = "0">
                <tr>
                    <th><?php __('Empleado'); ?></th>
                    <th><?php __('Traje'); ?></th>
                    <th><?php __('Pago a Empleado'); ?></th>
                    <th><?php __('Estado'); ?></th>
                </tr>
                <?php
                $i = 0;
                foreach ($production['JobsDetailsEmployee'] as $production_emp) {
                    $class = null;
                    if ($i++ % 2 == 0) {
                        $class = ' class="altrow"';
                    }
                    ?>
                    <tr<?php echo $class; ?>>
                        <td><?php echo $production_emp['employee_id'] != NULL ? $employees[$production_emp['employee_id']] : 'Sin Definir'; ?></td>
                        <td><?php echo $costumes[$production_emp['costume_id']]; ?></td>
                        <td>$<?php echo $production_emp['cost']; ?></td>
                        <?php
                        if ($production_emp['paid'] == 0) {
                            $estado = 'No Pagado';
                            $clase = 'no_paid';
                        } else {
                            $estado = 'Pagado';
                            $clase = 'paid';
                        }
                        ?>
                        <td class="<?php echo $clase ?>"><?php echo $estado; ?></td>
                    </tr>
                    <?php
                }
                ?>
            </table>
            <div class="job_sub_subtotal ver">
                Costo Obra = $<?php echo $production['JobsDetail']['cost']; ?>
            </div>
            <div class="clear"></div>
            <?php
        }
        ?>
        <div class="job_subtotal ver">
            Costo Total Obras = $<?php echo $costo_total_productions; ?>
        </div>
        <div class="clear"></div>
    </div>
    <?php
}
?>    
<br/>
<div class="resume_total ver">
    <p><b>Costo Total Alquiler Servicios</b> = $<?php echo $job['Job']['services_cost']; ?></p>
    <p><b>Costo Total Pago a Empleados</b> = $<?php echo $job['Job']['employee_cost']; ?></p>
    <p><b>Costo Total al Cliente</b> = $<?php echo $job['Job']['total_cost']; ?></p>
    <br/>
    <p><b>Ganancia Festilu</b> = $<?php echo $job['Job']['total_cost'] - $job['Job']['employee_cost'] - $job['Job']['services_cost']; ?></p>
</div>
<br/>
<div class="clear"></div>
<div class="related">
    <h2><?php __('Registro'); ?></h2>
    <table cellpadding = "0" cellspacing = "0">
        <tr>
            <th><?php __('Operación'); ?></th>
            <th><?php __('Usuario'); ?></th>
            <th><?php __('Fecha'); ?></th>
        </tr>                
        <?php
        if (empty($activities)) {
            ?> 
            <tr>
                <td colspan="3">No existen registros</td>
            </tr>
            <?php
        }
        $i = 0;
        foreach ($activities as $activity) {
            $class = null;
            if ($i++ % 2 == 0) {
                $class = ' class="altrow"';
            }
            ?>
            <tr<?php echo $class; ?>>
                <td>
                    <?php
                    if ($activity['Activity']['type'] == 'create') {
                        echo 'Creación';
                    } elseif ($activity['Activity']['type'] == 'update') {
                        echo 'Actualización';
                    } else {
                        echo 'Eliminación';
                    }
                    ?>
                </td>
                <td><?php echo $activity['User']['name']; ?></td>
                <td><?php echo $activity['Activity']['created']; ?></td>
            </tr>
            <?php
        }
        ?>
    </table>
</div>
<br/>
<div class="clear"></div>
<div class="actions">
    <h3><?php __('Acciones'); ?></h3>
    <ul>
        <li><?php echo $this->Html->link(__('Editar ' . $tipo, true), array('action' => 'edit', $job['Job']['id'])); ?> </li>
        <li><?php echo $this->Html->link(__('Eliminar ' . $tipo, true), array('action' => 'delete', $job['Job']['id']), null, sprintf('Seguro que desea eliminar este ' . $tipo . '?', $job['Job']['id'])); ?> </li>
        <?php if ($job['Job']['paid'] == 'no') { ?>
            <li><?php echo $this->Html->link(__('Pagado con Caja Chica ', true), array('action' => 'pay_job', $job['Job']['id'], 'chica'), null, sprintf('Seguro que desea marcar como pagado este ' . $tipo . ' utilizando la caja chica?', $job['Job']['id'])); ?> </li>
            <li><?php echo $this->Html->link(__('Pagado con Caja Grande ', true), array('action' => 'pay_job', $job['Job']['id'], 'grande'), null, sprintf('Seguro que desea marcar como pagado este ' . $tipo . ' utilizando la caja grande?', $job['Job']['id'])); ?> </li>
            <?php if ($header_tipo_usuario == GROUP_ADMIN) { ?>
                <li><?php echo $this->Html->link(__('Pagado sin Caja ', true), array('action' => 'pay_job', $job['Job']['id'], 'sin'), null, sprintf('Seguro que desea marcar como pagado este ' . $tipo . ' sin utilizar ninguna caja?', $job['Job']['id'])); ?> </li>
            <?php } ?>
        <?php } else {
            ?>
            <div class="paid_job">Trabajo Pagado</div>
            <?php
        }
        ?>
    </ul>
</div>
<script type="text/javascript">
        
    $().ready( function() {

        $("#JobViewForm").validate( {
            rules: {
                "data[Job][sign]": {
                    required: true,
                    number: true
                }
            },
            messages: {
                "data[Job][sign]": {
                    required: "<?php __('Ingrese la seña') ?>",
                    number: "<?php __('Ingrese un valor numérico') ?>"
                }
            }

        } );

        $("#MovementForm").validate( {
            rules: {
                "data[Job][amount]": {
                    required: true,
                    number: true
                }
            },
            messages: {
                "data[Job][amount]": {
                    required: "<?php __('Ingrese el monto') ?>",
                    number: "<?php __('Ingrese un valor numérico') ?>"
                }
            }

        } );
        
        $("#BigMovementForm").validate( {
            rules: {
                "data[Job][amount]": {
                    required: true,
                    number: true
                }
            },
            messages: {
                "data[Job][amount]": {
                    required: "<?php __('Ingrese el monto') ?>",
                    number: "<?php __('Ingrese un valor numérico') ?>"
                }
            }

        } );
    } );

    
    function mostrar_carga_senia(valor){
        if(valor == 1){
            //lo muestro
            $('#div_cargar_senia').slideDown();
        }else{
            //lo oculto
            $('#div_cargar_senia').slideUp();
        }
    }
    
    function mostrar_carga_movimiento(valor){
        if(valor == 1){
            //lo muestro
            $('#div_cargar_movimiento').slideDown();
        }else{
            //lo oculto
            $('#div_cargar_movimiento').slideUp();
        }
    }
    
    function mostrar_carga_movimiento_grande(valor){
        if(valor == 1){
            //lo muestro
            $('#div_cargar_movimiento_grande').slideDown();
        }else{
            //lo oculto
            $('#div_cargar_movimiento_grande').slideUp();
        }
    }
</script>
<style>
    #div_cargar_senia{
        border: none;
    }
    #div_cargar_movimiento, #div_cargar_movimiento_grande{
        border: none;
    }
    form div.submit {
        border: 0 none;
        clear: none;
        float: left;
        margin-left: 10px;
    }
</style>
